#include<iostream>
#include<string>
using namespace std;
int main()
{
	int t;
	cin >> t;
	getchar();
	while (t--) {
		string s;
		getline(cin, s);
		while (s.find("std::make_tuple") != -1) {
			int k = s.find("std::make_tuple");
			s.erase(s.begin() + k, s.begin() + k + 15);
		}
		cout << s << endl;
	}
	return 0;
}